package pl.rzarajczyk.utils.monitorcontroller;

import java.io.IOException;

/**
 *
 * @author rafalz
 */
class UnixMonitorController implements MonitorController {

    @Override
    public void turnOff() throws IOException {
        Runtime.getRuntime().exec("xset dpms force off");
    }

    @Override
    public void turnOn() throws IOException {
        try {
            Process p = Runtime.getRuntime().exec("xset dpms force on");
            p.waitFor();
            Runtime.getRuntime().exec("xset s reset");
        } catch (InterruptedException e) {
            throw new IOException(e);
        }
    }

    @Override
    public String toString() {
        return getClass().getSimpleName();
    }
    
}
